package 设计模式.SimpleFactory;

public class ComputerSimpleFactory {
    Computer makComputer(String type){
        switch (type) {
            case "laptop":
                return new Laptop();
            case "desktop":
                return new Desktop();
        }
        return null;
    }
    public static void main(String[] args) {
        ComputerSimpleFactory computerSimpleFactory = new ComputerSimpleFactory();
        Computer des = computerSimpleFactory.makComputer("desktop");
        Computer lap = computerSimpleFactory.makComputer("laptop");
        System.out.println(des == lap);
    }
}
